function interpolateAndOutput(startPoint: [number, number, number], endPoint: [number, number, number], duration: number) {
    const steps = 50; // 你可以根据需要调整步数，步数越多，输出越平滑
    const stepInterval = duration / steps;

    function linearInterpolate(start: number, end: number, t: number) {
        return start + (end - start) * t;
    }

    let currentStep = 0;
    const intervalId = setInterval(() => {
        if (currentStep >= steps) {
            clearInterval(intervalId); // 停止插值
        } else {
            const t = currentStep / steps; // 插值因子，从0到1
            const interpolatedHeight = linearInterpolate(startPoint[2], endPoint[2], t);
            const outputPoint = [startPoint[0], startPoint[1], interpolatedHeight];
            console.log(`Interpolated Point at step ${currentStep + 1}:`, outputPoint);
            currentStep++;
        }
    }, stepInterval);
}